package com.ihr360.payroll.service.payperiod;

import com.ihr360.commons.vo.PageData;
import com.ihr360.payroll.model.dto.salary.task.period.StaffPayPeriodTermSalary;
import com.ihr360.payroll.model.dto.salary.task.period.embeddable.StaffSalaryTermId;
import com.ihr360.payroll.model.response.salaryreport.BankPlateResponse;
import com.ihr360.payroll.model.response.salaryreport.SalaryReportResponse;
import com.ihr360.payroll.request.salaryReport.SalaryReportRequest;
import com.ihr360.rest.service.SimpleRestService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import java.util.Set;


public interface StaffPayPeriodTermSalaryService extends SimpleRestService<StaffPayPeriodTermSalary, StaffSalaryTermId> {

    List<StaffPayPeriodTermSalary> loadPayPeriodSalaryOfStaffs(Long termId, Set<String> staffIds);

    List<StaffPayPeriodTermSalary> getStaffSalaryByTerms(List<Long> termIds);

    Map<String, StaffPayPeriodTermSalary> loadPayperiodSalaryOfStaffsWithMapResult(Long termId, Set<String> staffIds);

    /**
     * 分页查询员工薪资信息列表
     */
    SalaryReportResponse queryStaffSalaryPageData(String companyId, SalaryReportRequest reportRequest);

    /**
     * 分页查询银行导盘
     */
    PageData<BankPlateResponse> queryBankPlate(String companyId, SalaryReportRequest reportRequest);

    /**
     * 导出银行导盘
     */
    void exportBankPlate(String companyId, SalaryReportRequest reportRequest, OutputStream out);

    /**
     * 导出薪资报表
     */
    void exportSalaryReport(String companyId, SalaryReportRequest reportRequest, OutputStream out);

    /**
     * 根据StaffIdList和termIdList获取所有
     */
    List<StaffPayPeriodTermSalary> queryMergeSalaryList(String companyId, List<Long> termIdList, List<String> staffIdList);

    /**
     * 更加StaffId 获取员工薪资结果, 根据薪资发放时间排序
     *
     * @param companyId
     * @param staffId
     * @return
     */
    List<StaffPayPeriodTermSalary> getByCompanyIdAndStaffIdOrderBySalaryTime(String companyId, String staffId);

    /**
     * 根据StaffIdList和termIdList分页获取
     */
    Page<StaffPayPeriodTermSalary> queryMergeSalaryPage(String companyId, List<Long> termIdList, List<String> staffIdList, Pageable pageable);

    /**
     * 分页查询审批薪资账期列表
     */
    SalaryReportResponse queryApprovalStaffSalary(String companyId, SalaryReportRequest reportRequest, Long historyPayPeriodId);

}